#include<iostream>
#include<cstdio>
using namespace std;

int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    int ncase;
    cin>>ncase;
    while(ncase--)
    {
        int n,i,tmp,sum=0;
        cin>>n;
        for(i=0;i<n;i++)
        {
            cin>>tmp;
            sum +=tmp;
        }
        cout<<sum<<endl;
        if(ncase>0) cout<<endl;
    }
    return 0;
}

